package com.tyc.springframework.jvm.jvmthorwable;

/**
 * 栈内存溢出异常
 * 设置栈容量
 *  -Xss128k
 */
public class StackOF {
    private int stackLength = 1;

    public void stackLeak(){
        stackLength++;
        stackLeak();
    }

    public static void main(String[] args) {
        StackOF stackOF = new StackOF();
        try {
            stackOF.stackLeak();
        } catch (Throwable e) {
            System.out.println("stack length:"+stackOF.stackLength);
            throw e;
        }
    }
}
